package com.ray.aop;

import org.springframework.aop.AfterAdvice;
import org.springframework.aop.AfterReturningAdvice;

import java.lang.reflect.Method;

public class AfterAop implements AfterReturningAdvice
{

    /**
     * @param returnValue
     * @param method
     * @param args
     * @param target
     * @throws Throwable
     */
    @Override
    public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable
    {
        System.out.println("++++++++++++++++++++");
        System.out.println("afterReturning中的 returnValue："+ returnValue);
        System.out.println("afterReturning中的 method："+ method.getName());
        for (Object arg : args)
        {
            System.out.println("afterReturning中的 arg："+arg.toString());
        }

        System.out.println("afterReturning中的 target："+target.toString());
        System.out.println("++++++++++++++++++++");

    }
}
